//
//  Video.m
//  openEye
//
//  Created by 徐悟源 on 16/3/31.
//  Copyright © 2016年 Wuyuan. All rights reserved.
//

#import "Video.h"
#import "Categories.h"
#import "CategoryTimeViewController.h"
#import "CategoryShareViewController.h"
#import "play.h"

@implementation Video

+ (NSDictionary *)objectClassInArray
{
    return @{@"playInfo" : [play class]};
}

+ (NSDictionary *)replacedKeyFromPropertyName
{
    return @{@"videoDescription" : @"description"};
}


+ (NSString *)toPathFromCategorie
{
    return @"http://baobab.wandoujia.com/api/v1/videos?";
    
}

+ (NSDictionary *)toParameterFromCategorie:(Categorie *)categorie WithController:(id)controller WithLength:(NSUInteger)length
{
    NSMutableDictionary *params = [NSMutableDictionary dictionary];
    
    params[@"num"] = @"10";
    params[@"categoryName"] = categorie.name;
    
    if([controller isKindOfClass:[CategoryTimeViewController class]])
    {
        params[@"strategy"] = @"date";
    }
    else if([controller isKindOfClass:[CategoryShareViewController class]])
    {
        params[@"strategy"] = @"shareCount";
    }
    
    params[@"start"] = [NSString stringWithFormat:@"%lu",(unsigned long)length];
    
    return params;
}


@end
